const events = require('events').EventEmitter;
const util = require('util');
const emitter = new events();
emitter.on('some', function(a1) {
    console.log(123);
});
emitter.emit('some');
emitter.on('error', function(a1) {
    console.log('error hander');
});
emitter.emit('error');

function Base() {
    this.name = 'base';
}

util.inherits(Base, events);
let base = new Base();
base.on('getName', function(arg1, arg2) {
    console.log(arg1, arg2);
});

setTimeout(() => {
    base.emit('getName', 'get', 'Name');
}, 1000);
